// $ANTLR 3.4 C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g 2012-10-10 15:54:03

package PL.prac4;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class Analexml extends Lexer {
    public static final int EOF=-1;
    public static final int BLANCO=4;
    public static final int COMENTARIO=5;
    public static final int DIGITO=6;
    public static final int END_TAG=7;
    public static final int IDENT=8;
    public static final int LETRA=9;
    public static final int NUEVA_LINEA=10;
    public static final int START_TAG=11;
    public static final int TEXT=12;

    public class MiToken extends CommonToken {
      private String nuevoAtributo;
      
      public MiToken (CharStream input, int type, int channel, int start, int stop) {
        super(input, type, channel, start, stop);
        nuevoAtributo = getSourceName();
      }
      public void setNuevoAtributo(String s) {
      nuevoAtributo=s;
      }
      public String getNuevoAtributo() {
      return nuevoAtributo;
      }
      public String toString() {
      String aux;
      aux = "Linea " + getLine() + ", "+ getCharPositionInLine()+ ": encontrado "+ getText() + ", Regla: " + getType();
      return aux;
      }
    }
    // override standard token emission
    public Token emit() {
        MiToken t = new MiToken(input, state.type, state.channel,
                        state.tokenStartCharIndex, getCharIndex()-1);
        t.setLine(state.tokenStartLine);
        t.setText(state.text);
        t.setCharPositionInLine(state.tokenStartCharPositionInLine);
        emit(t);
        return t;
    }



    // delegates
    // delegators
    public Lexer[] getDelegates() {
        return new Lexer[] {};
    }

    public Analexml() {} 
    public Analexml(CharStream input) {
        this(input, new RecognizerSharedState());
    }
    public Analexml(CharStream input, RecognizerSharedState state) {
        super(input,state);
    }
    public String getGrammarFileName() { return "C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g"; }

    // $ANTLR start "NUEVA_LINEA"
    public final void mNUEVA_LINEA() throws RecognitionException {
        try {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:46:23: ( '\\r\\n' )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:46:25: '\\r\\n'
            {
            match("\r\n"); 



            }


        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "NUEVA_LINEA"

    // $ANTLR start "BLANCO"
    public final void mBLANCO() throws RecognitionException {
        try {
            int _type = BLANCO;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:47:9: ( ( ' ' | '\\t' | NUEVA_LINEA ) )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:47:11: ( ' ' | '\\t' | NUEVA_LINEA )
            {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:47:11: ( ' ' | '\\t' | NUEVA_LINEA )
            int alt1=3;
            switch ( input.LA(1) ) {
            case ' ':
                {
                alt1=1;
                }
                break;
            case '\t':
                {
                alt1=2;
                }
                break;
            case '\r':
                {
                alt1=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 1, 0, input);

                throw nvae;

            }

            switch (alt1) {
                case 1 :
                    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:47:12: ' '
                    {
                    match(' '); 

                    }
                    break;
                case 2 :
                    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:47:16: '\\t'
                    {
                    match('\t'); 

                    }
                    break;
                case 3 :
                    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:47:21: NUEVA_LINEA
                    {
                    mNUEVA_LINEA(); 


                    }
                    break;

            }


            _channel = HIDDEN;

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "BLANCO"

    // $ANTLR start "DIGITO"
    public final void mDIGITO() throws RecognitionException {
        try {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:49:18: ( '0' .. '9' )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:
            {
            if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            }


        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "DIGITO"

    // $ANTLR start "LETRA"
    public final void mLETRA() throws RecognitionException {
        try {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:50:17: ( ( 'a' .. 'z' ) | ( 'A' .. 'Z' ) )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:
            {
            if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            }


        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "LETRA"

    // $ANTLR start "IDENT"
    public final void mIDENT() throws RecognitionException {
        try {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:51:17: ( ( LETRA | '_' ) ( DIGITO | LETRA | '_' )* )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:51:19: ( LETRA | '_' ) ( DIGITO | LETRA | '_' )*
            {
            if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:51:31: ( DIGITO | LETRA | '_' )*
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( ((LA2_0 >= '0' && LA2_0 <= '9')||(LA2_0 >= 'A' && LA2_0 <= 'Z')||LA2_0=='_'||(LA2_0 >= 'a' && LA2_0 <= 'z')) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:
            	    {
            	    if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            }


        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "IDENT"

    // $ANTLR start "START_TAG"
    public final void mSTART_TAG() throws RecognitionException {
        try {
            int _type = START_TAG;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:53:12: ( '<' IDENT '>' )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:53:14: '<' IDENT '>'
            {
            match('<'); 

            mIDENT(); 


            match('>'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "START_TAG"

    // $ANTLR start "END_TAG"
    public final void mEND_TAG() throws RecognitionException {
        try {
            int _type = END_TAG;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:54:10: ( '</' IDENT '>' )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:54:12: '</' IDENT '>'
            {
            match("</"); 



            mIDENT(); 


            match('>'); 

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "END_TAG"

    // $ANTLR start "TEXT"
    public final void mTEXT() throws RecognitionException {
        try {
            int _type = TEXT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:56:7: ( (~ ( '<' | '&' ) | '&amp;' | '&gt;' )+ )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:56:9: (~ ( '<' | '&' ) | '&amp;' | '&gt;' )+
            {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:56:9: (~ ( '<' | '&' ) | '&amp;' | '&gt;' )+
            int cnt3=0;
            loop3:
            do {
                int alt3=4;
                int LA3_0 = input.LA(1);

                if ( ((LA3_0 >= '\u0000' && LA3_0 <= '%')||(LA3_0 >= '\'' && LA3_0 <= ';')||(LA3_0 >= '=' && LA3_0 <= '\uFFFF')) ) {
                    alt3=1;
                }
                else if ( (LA3_0=='&') ) {
                    int LA3_3 = input.LA(2);

                    if ( (LA3_3=='a') ) {
                        alt3=2;
                    }
                    else if ( (LA3_3=='g') ) {
                        alt3=3;
                    }


                }


                switch (alt3) {
            	case 1 :
            	    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:56:10: ~ ( '<' | '&' )
            	    {
            	    if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '%')||(input.LA(1) >= '\'' && input.LA(1) <= ';')||(input.LA(1) >= '=' && input.LA(1) <= '\uFFFF') ) {
            	        input.consume();
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        recover(mse);
            	        throw mse;
            	    }


            	    }
            	    break;
            	case 2 :
            	    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:56:21: '&amp;'
            	    {
            	    match("&amp;"); 



            	    }
            	    break;
            	case 3 :
            	    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:56:29: '&gt;'
            	    {
            	    match("&gt;"); 



            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "TEXT"

    // $ANTLR start "COMENTARIO"
    public final void mCOMENTARIO() throws RecognitionException {
        try {
            int _type = COMENTARIO;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:58:13: ( ( '<!--' ( options {greedy=false; } : . )* '-->' ) )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:58:15: ( '<!--' ( options {greedy=false; } : . )* '-->' )
            {
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:58:15: ( '<!--' ( options {greedy=false; } : . )* '-->' )
            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:58:16: '<!--' ( options {greedy=false; } : . )* '-->'
            {
            match("<!--"); 



            // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:58:23: ( options {greedy=false; } : . )*
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( (LA4_0=='-') ) {
                    int LA4_1 = input.LA(2);

                    if ( (LA4_1=='-') ) {
                        int LA4_3 = input.LA(3);

                        if ( (LA4_3=='>') ) {
                            alt4=2;
                        }
                        else if ( ((LA4_3 >= '\u0000' && LA4_3 <= '=')||(LA4_3 >= '?' && LA4_3 <= '\uFFFF')) ) {
                            alt4=1;
                        }


                    }
                    else if ( ((LA4_1 >= '\u0000' && LA4_1 <= ',')||(LA4_1 >= '.' && LA4_1 <= '\uFFFF')) ) {
                        alt4=1;
                    }


                }
                else if ( ((LA4_0 >= '\u0000' && LA4_0 <= ',')||(LA4_0 >= '.' && LA4_0 <= '\uFFFF')) ) {
                    alt4=1;
                }


                switch (alt4) {
            	case 1 :
            	    // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:58:48: .
            	    {
            	    matchAny(); 

            	    }
            	    break;

            	default :
            	    break loop4;
                }
            } while (true);


            match("-->"); 



            }


            _channel = HIDDEN;

            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
    // $ANTLR end "COMENTARIO"

    public void mTokens() throws RecognitionException {
        // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:1:8: ( BLANCO | START_TAG | END_TAG | TEXT | COMENTARIO )
        int alt5=5;
        int LA5_0 = input.LA(1);

        if ( (LA5_0==' ') ) {
            int LA5_1 = input.LA(2);

            if ( ((LA5_1 >= '\u0000' && LA5_1 <= ';')||(LA5_1 >= '=' && LA5_1 <= '\uFFFF')) ) {
                alt5=4;
            }
            else {
                alt5=1;
            }
        }
        else if ( (LA5_0=='\t') ) {
            int LA5_2 = input.LA(2);

            if ( ((LA5_2 >= '\u0000' && LA5_2 <= ';')||(LA5_2 >= '=' && LA5_2 <= '\uFFFF')) ) {
                alt5=4;
            }
            else {
                alt5=1;
            }
        }
        else if ( (LA5_0=='\r') ) {
            int LA5_3 = input.LA(2);

            if ( (LA5_3=='\n') ) {
                int LA5_7 = input.LA(3);

                if ( ((LA5_7 >= '\u0000' && LA5_7 <= ';')||(LA5_7 >= '=' && LA5_7 <= '\uFFFF')) ) {
                    alt5=4;
                }
                else {
                    alt5=1;
                }
            }
            else {
                alt5=4;
            }
        }
        else if ( (LA5_0=='<') ) {
            switch ( input.LA(2) ) {
            case '/':
                {
                alt5=3;
                }
                break;
            case '!':
                {
                alt5=5;
                }
                break;
            case 'A':
            case 'B':
            case 'C':
            case 'D':
            case 'E':
            case 'F':
            case 'G':
            case 'H':
            case 'I':
            case 'J':
            case 'K':
            case 'L':
            case 'M':
            case 'N':
            case 'O':
            case 'P':
            case 'Q':
            case 'R':
            case 'S':
            case 'T':
            case 'U':
            case 'V':
            case 'W':
            case 'X':
            case 'Y':
            case 'Z':
            case '_':
            case 'a':
            case 'b':
            case 'c':
            case 'd':
            case 'e':
            case 'f':
            case 'g':
            case 'h':
            case 'i':
            case 'j':
            case 'k':
            case 'l':
            case 'm':
            case 'n':
            case 'o':
            case 'p':
            case 'q':
            case 'r':
            case 's':
            case 't':
            case 'u':
            case 'v':
            case 'w':
            case 'x':
            case 'y':
            case 'z':
                {
                alt5=2;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 4, input);

                throw nvae;

            }

        }
        else if ( ((LA5_0 >= '\u0000' && LA5_0 <= '\b')||(LA5_0 >= '\n' && LA5_0 <= '\f')||(LA5_0 >= '\u000E' && LA5_0 <= '\u001F')||(LA5_0 >= '!' && LA5_0 <= ';')||(LA5_0 >= '=' && LA5_0 <= '\uFFFF')) ) {
            alt5=4;
        }
        else {
            NoViableAltException nvae =
                new NoViableAltException("", 5, 0, input);

            throw nvae;

        }
        switch (alt5) {
            case 1 :
                // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:1:10: BLANCO
                {
                mBLANCO(); 


                }
                break;
            case 2 :
                // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:1:17: START_TAG
                {
                mSTART_TAG(); 


                }
                break;
            case 3 :
                // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:1:27: END_TAG
                {
                mEND_TAG(); 


                }
                break;
            case 4 :
                // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:1:35: TEXT
                {
                mTEXT(); 


                }
                break;
            case 5 :
                // C:\\Users\\GMIRIAM\\workspace\\prac4\\src\\main\\java\\PL\\prac4\\Analexml.g:1:40: COMENTARIO
                {
                mCOMENTARIO(); 


                }
                break;

        }

    }


 

}